-- GENERATED SPELL FOR [Smolderthorn Witch Doctor] --


function spell0_9266(pUnit, Event) --@Elemental Protection Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(8262,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_9266', 1, 1)
end

function spell1_9266(pUnit, Event) --@Flame Buffet Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(15867,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_9266', 1, 1)
end

function spell2_9266(pUnit, Event) --@Superior Healing Ward,Self--
pUnit:FullCastSpellOnTarget(15869,pUnit)
pUnit:RegisterEvent('Sorts_9266', 32000, 1)
end

function Sorts_9266(pUnit, Event)
local choix_sorts_9266 = math.random(0, 2)
if choix_sorts_9266 == 0 then
pUnit:RegisterEvent('spell0_9266', 1, 1)
end
if choix_sorts_9266 == 1 then
pUnit:RegisterEvent('spell1_9266', 1, 1)
end
if choix_sorts_9266 == 2 then
pUnit:RegisterEvent('spell2_9266', 1, 1)
end
end

function mob9266_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_9266', math.random(1500, 3000), 1)
end

function mob9266_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob9266_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob9266_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(9266, 1, 'mob9266_Action')
RegisterUnitEvent(9266, 2, 'mob9266_Leave')
RegisterUnitEvent(9266, 3, 'mob9266_Kill')
RegisterUnitEvent(9266, 4, 'mob9266_Die')
